package jp.ne.hatena.d.digitalsoul.warikan.contexts

import jp.ne.hatena.d.digitalsoul.warikan.contexts.rootpopulaters._
import jp.ne.hatena.d.digitalsoul.warikan.models._
import jp.ne.hatena.d.digitalsoul.warikan.repositories._
import jp.ne.hatena.d.digitalsoul.warikan.roles._

class Paying(val id:Int) extends PartyPopulater {
	
	val payer:Payer = new Party(id) with Payer
	
	val party:Party = populateParty(payer)
	
	def pay(sum:Int) = payer.pay(sum)
	
	def sum:Int = payer.sum
	
	def commit = PartyRepository.add(party)

}